import request from '@/utils/request';
import { FindScheduleItem } from '@/type/scheduleType';
import { Response } from '@/type/ResponseType';
import { Patient } from '@/type/bookingType';

enum Enum {
  fetchScheduleInfoAPI = '/hosp/hospital/getSchedule',
  fetchPatientAPI = '/user/patient/auth/findAll',
  submitOrderAPI = '/order/orderInfo/auth/submitOrder',
}

/**
 * @description 根据排班id获取排班数据的接口
 * */
export const fetchScheduleAPI = (scheduleId: string) => request.get<FindScheduleItem, Response<FindScheduleItem>>(`${Enum.fetchScheduleInfoAPI}/${scheduleId}`);

/**
 *
 * @description 获取就诊人列表的接口
 * */
export const fetchPatientAPI = () => request.get<Patient, Response<Patient[]>>(Enum.fetchPatientAPI);

/**
 * @description 确认挂号提交订单的接口
 * */
export const submitOrderAPI = (hoscode: string | undefined, scheduleId: string | undefined, patientId: number|undefined) => request.post(`${Enum.submitOrderAPI}/${hoscode}/${scheduleId}/${patientId}`);
